package com.alibaba.luohua.product.service.impl;

import com.alibaba.luohua.common.core.dto.request.ArticleQueryObject;
import com.alibaba.luohua.common.core.dto.respone.ArticleDTO;
import com.alibaba.luohua.common.core.dto.respone.ArticleRspDTO;
import com.alibaba.luohua.product.entity.ArticleEntity;
import com.alibaba.luohua.product.mapper.ArticleMapper;
import com.alibaba.luohua.product.service.ArticleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 物品业务实现层
 *
 * @author 罗华
 * @date 2022/3/15
 */
@Service("articleService")
@Slf4j
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, ArticleEntity> implements ArticleService {


    /**
     * 查询物品信息详情
     *
     * @param id
     * @return
     */
    @Override
    public ArticleRspDTO get(Long id) {

        return this.baseMapper.selectById(id);
    }

    /**
     * 分页查询物品信息列表
     *
     * @param pageDTO
     * @return
     */
    @Override
    public List<ArticleDTO> queryForList(ArticleQueryObject pageDTO) {

        return this.baseMapper.selectForList(pageDTO);
    }
}
